﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using ZH.GPT.Infrastructures.Entities;

namespace ZH.GPT.Utils
{
    public class MessageRoleHelper
    {
        public static MessageRole GetRole(string rolestr)
        {
            if (rolestr == "system")
                return MessageRole.System;
            else if (rolestr == "user")
                return MessageRole.User;
            else if (rolestr == "assitant")
                return MessageRole.Assistant;
            else
                throw new Exception("chat角色错误");
        }
    }
}
